/**
 * 
 */
package com.manage.action;

import java.util.Calendar;
import java.util.List;

import org.apache.log4j.Logger;


import com.action.AbstractAction;
import com.manage.cache.PhoneAddressManager;
import com.manage.model.PhoneAddress;
import com.manage.service.PhoneAddressService;
import com.manage.service.PhoneAddressServiceImpl;


public class PhoneAddressAction extends AbstractAction {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	private Logger logger;
	
	public PhoneAddressAction()
	{
		logger = Logger.getLogger(this.getClass());
	}
	
	public String execute()
	{
		return SUCCESS;
	}

	private List<PhoneAddress> list;
	private PhoneAddress       model;
	private String        type;
	
	public String show()
	{
		list = PhoneAddressManager.getInstance().getPhoneAddresss();
		if (list!=null && list.size()>0)
		{
			model = list.get(0);
			type = "update";
		}
		else
		{
			model = new PhoneAddress();
			model.setId(-1);
			type = "insert";
		}

		return SUCCESS;
	}
	public String save()
	{
		PhoneAddressManager.getInstance().savePhoneAddress(operator, type, model);
		return SUCCESS;
	}
	public List<PhoneAddress> getList() {
		return list;
	}

	public void setList(List<PhoneAddress> list) {
		this.list = list;
	}

	public PhoneAddress getModel() {
		return model;
	}

	public void setModel(PhoneAddress model) {
		this.model = model;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}
	
	
	
}
